package cn.xiehang.SoundSight;

import android.net.Uri;

public class RecyclerViewItem {
    private String title;
    private Uri imageUrl; // 或 int imageResId 如果你使用本地资源
    private int width;    // 新增：图片宽度
    private int height;   // 新增：图片高度

    public RecyclerViewItem(String title, Uri imageUrl) {
        this.title = title;
        this.imageUrl = imageUrl;
        this.width = -1;  // 默认不设置
        this.height = -1; // 默认不设置
    }
    public RecyclerViewItem(String title, int imageResId) {
        this.title = title;
        this.imageUrl = Uri.parse("android.resource://" + "cn.xiehang.SoundSight" + "/" + imageResId);
        this.width = -1;  // 默认不设置
        this.height = -1; // 默认不设置
    }
    public RecyclerViewItem(String title, int imageResId, int width, int height) {
        this.title = title;
        this.imageUrl = Uri.parse("android.resource://" + "cn.xiehang.SoundSight" + "/" + imageResId);
        this.width = width;
        this.height = height;
    }
    public RecyclerViewItem(String title) {
        this.title = title;
        this.imageUrl = null; // 或者设置一个默认图片
    }
    // Getter 方法
    public int getWidth() {
        return width;
    }

    public int getHeight() {
        return height;
    }


    // Getter方法
    public String getTitle() { return title; }
    public Uri getImageUrl() { return imageUrl; }
}
